function invest() {
	$.ajax({
		url: '/spider-factory/stock/invest',
		type: 'POST',
		data: {
			firm_id: firm_id,
			page: "1",
			size: "10"
		},
		success: function(res){
			let resObj=JSON.parse(res)
			let list=resObj.list
			let num=1
			if(list.length>0){
				for(const i in list){
					$('#invest').append(
						'<tr>'+
							'<td>'+num+'</td>'+
							'<td>'+list[i].be_invest_firm_name+'</td>'+
							'<td>'+list[i].be_invest_person_name+'</td>'+
							'<td>'+(list[i].be_invest_firm_establish_time=="" ? "" : list[i].be_invest_firm_establish_time.substring(0,10))+'</td>'+
							'<td>'+list[i].investments+'</td>'+
							'<td>'+(list[i].investment_percent=="" ? "" : list[i].investment_percent+"%")+'</td>'+
							'<td>'+(list[i].be_invest_firm_status=="0" ? "注销" : "开业")+'</td>'+
						'</tr>'
					)
					num+=1
				}
				if(resObj.totalPage>1){
					$('#invest').append(
						'<tr>'+
							'<td colspan="7" style="text-align:center;"><a href="/spider-factory/stock/invest-more?firm_id='+firm_id+'&companyName='+stock+'" target="_blank">查看更多</a></td>'+
						'</tr>'
					)
				}
			}else{
				$('#invest_show').hide()
				$('#invest_show').prev().hide()
			}
		},
		error: function(res){
			console.log(res)
		}
	})
}

function controlShare() {
	$.ajax({
		url: '/spider-factory/stock/controlShare',
		type: 'POST',
		data: {
			firm_id: firm_id,
			page: "1",
			size: "10"
		},
		success: function(res){
			let resObj=JSON.parse(res)
			let list=resObj.list
			let num=1
			if(list.length>0){
				for(const i in list){
					$('#controlShare').append(
						'<tr>'+
							'<td>'+num+'</td>'+
							'<td>'+list[i].be_invest_firm_name+'</td>'+
							'<td>'+list[i].be_invest_person_name+'</td>'+
							'<td>'+(list[i].be_invest_firm_establish_time=="" ? "" : list[i].be_invest_firm_establish_time.substring(0,10))+'</td>'+
							'<td>'+list[i].investments+'</td>'+
							'<td>'+(list[i].investment_percent=="" ? "" : list[i].investment_percent+"%")+'</td>'+
							'<td>'+(list[i].be_invest_firm_status=="0" ? "注销" : "开业")+'</td>'+
						'</tr>'
					)
					num+=1
				}
				if(resObj.totalPage>1){
					$('#controlShare').append(
						'<tr>'+
							'<td colspan="7" style="text-align:center;"><a href="/spider-factory/stock/controlShare-more?firm_id='+firm_id+'&companyName='+stock+'" target="_blank">查看更多</a></td>'+
						'</tr>'
					)
				}
			}else{
				$('#controlShare_show').hide()
				$('#controlShare_show').prev().hide()
			}
		},
		error: function(res){
			console.log(res)
		}
	})
}